package com.tms.app.tms.ui.base.ui;

import android.support.v4.widget.SwipeRefreshLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.tms.app.tms.R;
import com.tms.app.tms.ui.base.view.IListView;

/**
 * Created by happy on 2017/8/26.
 */

public  abstract class BaseListFragmnet extends BaseFragment implements IListView {

    protected BaseQuickAdapter adapter;



    @Override
    public void pullMoreComlite(String... msg) {

    }

    @Override
    public void pullMoreNoMore(String... msg) {

    }

    @Override
    public void refreshComplite(String... msg) {
        hideLoadingDialog();
        hideNerError();
        try {
            ((SwipeRefreshLayout)rootView.findViewById(R.id.swipeLayout)).setRefreshing(false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void refreshNoData(String... msg) {
        hideLoadingDialog();
        try {
            ((SwipeRefreshLayout)rootView.findViewById(R.id.swipeLayout)).setRefreshing(false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void handlerErrorMsg(int errorCode) {

    }


    public BaseQuickAdapter getAdapter(int type) {
        return  adapter;
    }
}
